/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sellcar;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Fabio Valenzuela
 */
public class Pedidos_Veiculo extends javax.swing.JFrame {
    private Connection connection;
    /**
     * Creates new form Pedidos_Veiculo
     */
    public Pedidos_Veiculo() {
        initComponents();
        this.setLocationRelativeTo(null);
        this.connection = new ConnectionFactory().getConnection();
        getRootPane().setDefaultButton(BtAtualizar);  

    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        ChBanco = new javax.swing.JCheckBox();
        CodCarroPlaca = new javax.swing.JTextField();
        InfCadCarroPlaca = new javax.swing.JLabel();
        Titulo = new javax.swing.JLabel();
        Dados_Veiculo = new javax.swing.JPanel();
        Opcionais = new javax.swing.JLabel();
        RdEstado = new javax.swing.JRadioButton();
        jSeparator1 = new javax.swing.JSeparator();
        jSeparator3 = new javax.swing.JSeparator();
        RdOrigem = new javax.swing.JRadioButton();
        ChCompu = new javax.swing.JCheckBox();
        ChDesen = new javax.swing.JCheckBox();
        ChLimpador = new javax.swing.JCheckBox();
        ChDvd = new javax.swing.JCheckBox();
        ChVidros = new javax.swing.JCheckBox();
        ChSensor = new javax.swing.JCheckBox();
        ChTeto = new javax.swing.JCheckBox();
        ChAbs = new javax.swing.JCheckBox();
        ChDirHi = new javax.swing.JCheckBox();
        ChTravas = new javax.swing.JCheckBox();
        ChArCond = new javax.swing.JCheckBox();
        ChAirBag = new javax.swing.JCheckBox();
        ChAlarme = new javax.swing.JCheckBox();
        ChCd = new javax.swing.JCheckBox();
        TxTFab = new javax.swing.JTextField();
        CombPortas = new javax.swing.JComboBox();
        CombCambio = new javax.swing.JComboBox();
        CombCombust = new javax.swing.JComboBox();
        CombMarca = new javax.swing.JComboBox();
        CombModelo = new javax.swing.JComboBox();
        Km = new javax.swing.JLabel();
        Cor = new javax.swing.JLabel();
        jSeparator2 = new javax.swing.JSeparator();
        Fabric = new javax.swing.JLabel();
        Placa = new javax.swing.JLabel();
        TxtPlaca = new javax.swing.JFormattedTextField();
        TxtKm = new javax.swing.JTextField();
        TxtCor = new javax.swing.JTextField();
        ChBanco1 = new javax.swing.JCheckBox();
        jPanel2 = new javax.swing.JPanel();
        ValorVeiculo = new javax.swing.JLabel();
        Entrada = new javax.swing.JLabel();
        ValorFinanciado = new javax.swing.JLabel();
        Parcelado = new javax.swing.JLabel();
        TxtValorVeiculo = new sellcar.JNumberFormatField();
        TxtEntrada = new sellcar.JNumberFormatField();
        TxtValorFinanciado = new sellcar.JNumberFormatField();
        TxtParcelado = new sellcar.JNumberFormatField();
        TxtCodCliente = new javax.swing.JTextField();
        CodCliente = new javax.swing.JLabel();
        BtNovoCliente = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        TxtNomeCliente = new javax.swing.JTextField();
        BrGerarVenda = new javax.swing.JButton();
        BtVoltar = new javax.swing.JButton();
        BtAtualizar = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jButton6 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        jButton8 = new javax.swing.JButton();
        jButton9 = new javax.swing.JButton();
        jButton10 = new javax.swing.JButton();

        ChBanco.setText("Banco de Couro");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        CodCarroPlaca.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        InfCadCarroPlaca.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        InfCadCarroPlaca.setText("Cod/Placa Veiculo");

        Titulo.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        Titulo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        Titulo.setText("Venda de Veículo");

        Dados_Veiculo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3));

        Opcionais.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        Opcionais.setText("Opcionais");

        RdEstado.setSelected(true);

        RdOrigem.setSelected(true);

        ChCompu.setText("Computador de Bordo");

        ChDesen.setText("Desembaçador Traseiro");

        ChLimpador.setText("Limpador Traseiro");

        ChDvd.setText("DVD Player");

        ChVidros.setText("Vidros Eletricos");

        ChSensor.setText("Sensor de Estacionamento");

        ChTeto.setText("Teto Solar");

        ChAbs.setText("Freio ABS");

        ChDirHi.setText("Direção Hidraulica");

        ChTravas.setText("Travas Eletricas");

        ChArCond.setText("Ar Condicionado");

        ChAirBag.setText("Air Bag");

        ChAlarme.setText("Alarme");

        ChCd.setText("CD Player");

        TxTFab.setEditable(false);
        TxTFab.setHorizontalAlignment(javax.swing.JTextField.CENTER);

        CombPortas.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Portas" }));

        CombCambio.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Câmbio" }));

        CombCombust.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Combustível" }));

        CombMarca.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Marca" }));

        CombModelo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Modelo" }));

        Km.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        Km.setText("Kilometragem");

        Cor.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        Cor.setText("Cor");

        Fabric.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        Fabric.setText("Ano de Fab.");

        Placa.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        Placa.setText("Placa");

        TxtPlaca.setEditable(false);
        try {
            TxtPlaca.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("AAA-AAAA")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        TxtKm.setEditable(false);

        TxtCor.setEditable(false);

        ChBanco1.setText("Banco de Couro");

        javax.swing.GroupLayout Dados_VeiculoLayout = new javax.swing.GroupLayout(Dados_Veiculo);
        Dados_Veiculo.setLayout(Dados_VeiculoLayout);
        Dados_VeiculoLayout.setHorizontalGroup(
            Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Dados_VeiculoLayout.createSequentialGroup()
                .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(Dados_VeiculoLayout.createSequentialGroup()
                        .addGap(55, 55, 55)
                        .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(Dados_VeiculoLayout.createSequentialGroup()
                                .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ChAirBag)
                                    .addComponent(ChAlarme)
                                    .addComponent(ChCd)
                                    .addComponent(ChDvd)
                                    .addComponent(ChArCond))
                                .addGap(24, 24, 24)
                                .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ChTeto)
                                    .addComponent(ChDirHi)
                                    .addComponent(ChAbs)
                                    .addComponent(ChVidros)
                                    .addComponent(ChTravas))
                                .addGap(18, 18, 18)
                                .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(ChCompu)
                                    .addComponent(ChSensor)
                                    .addComponent(ChDesen)
                                    .addComponent(ChLimpador)
                                    .addComponent(ChBanco1)))
                            .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(Dados_VeiculoLayout.createSequentialGroup()
                                    .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addComponent(TxTFab, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(Fabric, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(18, 18, 18)
                                    .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                        .addComponent(Placa, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(TxtPlaca, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(TxtKm, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(Km, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(18, 18, 18)
                                    .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(TxtCor, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(Cor, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addComponent(Opcionais, javax.swing.GroupLayout.PREFERRED_SIZE, 381, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(Dados_VeiculoLayout.createSequentialGroup()
                        .addGap(36, 36, 36)
                        .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 512, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(Dados_VeiculoLayout.createSequentialGroup()
                                .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(Dados_VeiculoLayout.createSequentialGroup()
                                        .addGap(19, 19, 19)
                                        .addComponent(CombMarca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(CombModelo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(CombCombust, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(Dados_VeiculoLayout.createSequentialGroup()
                                        .addGap(166, 166, 166)
                                        .addComponent(RdOrigem)))
                                .addGap(18, 18, 18)
                                .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(RdEstado)
                                    .addGroup(Dados_VeiculoLayout.createSequentialGroup()
                                        .addComponent(CombCambio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(CombPortas, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)))))))
                .addContainerGap(78, Short.MAX_VALUE))
            .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(Dados_VeiculoLayout.createSequentialGroup()
                    .addGap(55, 55, 55)
                    .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 1, Short.MAX_VALUE)
                        .addComponent(jSeparator3))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );
        Dados_VeiculoLayout.setVerticalGroup(
            Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Dados_VeiculoLayout.createSequentialGroup()
                .addGap(15, 15, 15)
                .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(RdEstado, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(RdOrigem))
                .addGap(18, 18, 18)
                .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(CombMarca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(CombModelo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(CombCombust, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(CombCambio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(CombPortas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(11, 11, 11)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Fabric)
                    .addComponent(Placa)
                    .addComponent(Km)
                    .addComponent(Cor))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(TxTFab, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TxtKm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TxtCor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TxtPlaca))
                .addGap(15, 15, 15)
                .addComponent(Opcionais)
                .addGap(18, 18, 18)
                .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(Dados_VeiculoLayout.createSequentialGroup()
                        .addComponent(ChSensor)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(ChBanco1)
                        .addGap(3, 3, 3)
                        .addComponent(ChLimpador))
                    .addGroup(Dados_VeiculoLayout.createSequentialGroup()
                        .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ChAirBag)
                            .addComponent(ChDirHi))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ChAlarme)
                            .addComponent(ChAbs))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ChTravas)
                            .addComponent(ChArCond))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(Dados_VeiculoLayout.createSequentialGroup()
                        .addComponent(ChDesen)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(ChCompu))
                    .addGroup(Dados_VeiculoLayout.createSequentialGroup()
                        .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ChCd)
                            .addComponent(ChVidros))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ChDvd)
                            .addComponent(ChTeto))))
                .addGap(16, 16, 16))
            .addGroup(Dados_VeiculoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(Dados_VeiculoLayout.createSequentialGroup()
                    .addGap(32, 32, 32)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(99, 99, 99)
                    .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(177, Short.MAX_VALUE)))
        );

        ValorVeiculo.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        ValorVeiculo.setText("Valor do Veiculo");

        Entrada.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        Entrada.setText("Entrada");

        ValorFinanciado.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        ValorFinanciado.setText("Valor Financiado");

        Parcelado.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        Parcelado.setText("Parcelado");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(ValorVeiculo)
                            .addComponent(Entrada))
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(18, 18, 18)
                                .addComponent(TxtValorVeiculo, javax.swing.GroupLayout.DEFAULT_SIZE, 132, Short.MAX_VALUE))
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(17, 17, 17)
                                .addComponent(TxtEntrada, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(ValorFinanciado)
                            .addComponent(Parcelado))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(TxtValorFinanciado, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(TxtParcelado, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addContainerGap(38, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ValorVeiculo)
                    .addComponent(TxtValorVeiculo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Entrada)
                    .addComponent(TxtEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(ValorFinanciado)
                    .addComponent(TxtValorFinanciado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Parcelado)
                    .addComponent(TxtParcelado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(14, Short.MAX_VALUE))
        );

        TxtCodCliente.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        CodCliente.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        CodCliente.setText("Cod Cliente");

        BtNovoCliente.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        BtNovoCliente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sellcar/Icones/page_edit.png"))); // NOI18N
        BtNovoCliente.setText("Cadastro Novo Cliente");
        BtNovoCliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BtNovoClienteActionPerformed(evt);
            }
        });

        TxtNomeCliente.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(TxtNomeCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 295, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 20, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(TxtNomeCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        BrGerarVenda.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        BrGerarVenda.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sellcar/Icones/printer.png"))); // NOI18N
        BrGerarVenda.setText("Gerar Venda");
        BrGerarVenda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BrGerarVendaActionPerformed(evt);
            }
        });

        BtVoltar.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        BtVoltar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sellcar/Icones/arrow_left.png"))); // NOI18N
        BtVoltar.setMnemonic('S');
        BtVoltar.setText("Voltar");
        BtVoltar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BtVoltarActionPerformed(evt);
            }
        });

        BtAtualizar.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        BtAtualizar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sellcar/Icones/update.png"))); // NOI18N
        BtAtualizar.setMnemonic('A');
        BtAtualizar.setText("Atualizar");
        BtAtualizar.setToolTipText("");
        BtAtualizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BtAtualizarActionPerformed(evt);
            }
        });

        jButton6.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sellcar/Icones/delete.png"))); // NOI18N
        jButton6.setText("Excluir");

        jButton7.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jButton7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sellcar/Icones/resultset_next.png"))); // NOI18N
        jButton7.setText("Proximo");

        jButton8.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jButton8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sellcar/Icones/pencil.png"))); // NOI18N
        jButton8.setText("Alterar");

        jButton9.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jButton9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sellcar/Icones/resultset_previous.png"))); // NOI18N
        jButton9.setText("Anterior");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jButton7, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)
                    .addComponent(jButton6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                        .addGap(5, 5, 5)
                        .addComponent(jButton9)))
                .addGap(0, 17, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton8)
                    .addComponent(jButton6))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton7)
                    .addComponent(jButton9))
                .addContainerGap())
        );

        jButton10.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        jButton10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sellcar/Icones/find.png"))); // NOI18N
        jButton10.setText("Pesquisa");
        jButton10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton10ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(Dados_Veiculo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(31, 31, 31)
                        .addComponent(CodCarroPlaca, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(4, 4, 4)
                        .addComponent(InfCadCarroPlaca)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(BtAtualizar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 342, Short.MAX_VALUE))
                    .addComponent(Titulo, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(TxtCodCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(10, 10, 10)
                                .addComponent(CodCliente)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(BtNovoCliente))
                            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(8, 8, 8))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(BrGerarVenda)
                                .addGap(18, 18, 18)
                                .addComponent(jButton10)))
                        .addGap(57, 57, 57)))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(BtVoltar)
                        .addContainerGap())))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(Titulo)
                .addGap(11, 11, 11)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(CodCarroPlaca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(InfCadCarroPlaca)
                            .addComponent(BtAtualizar))))
                .addGap(4, 4, 4)
                .addComponent(Dados_Veiculo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(27, 27, 27)
                        .addComponent(BtVoltar))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(40, 40, 40)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(TxtCodCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(3, 3, 3)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(CodCliente)
                                    .addComponent(BtNovoCliente))))
                        .addGap(8, 8, 8)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(BrGerarVenda)
                            .addComponent(jButton10))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(10, 10, 10))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void BtVoltarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtVoltarActionPerformed
        // Botão Voltar
        // Encerra a tela de cadastro
        this.dispose();
    }//GEN-LAST:event_BtVoltarActionPerformed

    private void BtNovoClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtNovoClienteActionPerformed
        Cadastro_Cliente c = null;
        try {
            c = new Cadastro_Cliente();
        } catch (SQLException ex) {
            Logger.getLogger(Pedidos_Veiculo.class.getName()).log(Level.SEVERE, null, ex);
        }
            c.setVisible(true);

    }//GEN-LAST:event_BtNovoClienteActionPerformed

    private void BtAtualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtAtualizarActionPerformed
        // botão atualizar dados;
        String buscar = CodCarroPlaca.getText();
        try {             
            ResultSet rs = null;
            String sql = "SELECT DESC_ORIGEM,DESC_ESTADO,D.desc_MARCA,desc_cambio,C.desc_MODELO,desc_combustivel,DESC_MODELO_ANO,PLACA,KILOMETRAGEM,COR,AIRBAG,ALARME,AR_CONDICIONADO,CD_PLAYER,DVD_PLAYER,DIR_HIDRAULICA,FREIOS_ABS,TRAVAS_ELETR,VIDROS_ELETR,VALOR_COMPRA,TETO_SOLAR,SENSOR_ESTAC,BANCO_COURO,LIMPADOR_TRAS,DESEMB_TRASEIRO,COMP_BORDO,DESC_PORTA "
            + "from tb_cadastro_veiculos A INNER JOIN TB_COMBUSTIVEL B ON A.id_combustivel = B.id_comb INNER JOIN TB_MARCA D ON A.ID_MARCA = D.ID_MARCA INNER JOIN TB_MODELO C ON A.ID_MODELO = C.ID_MODELO AND C.ID_MARCA = A.ID_MARCA INNER JOIN TB_PORTA E ON A.ID_PORTA = E.ID_PORTA INNER JOIN TB_CAMBIO F ON A.ID_CAMBIO = F.ID_CAMBIO where placa = " +'"' +buscar+'"';
            PreparedStatement stmt = connection.prepareStatement(sql);
            rs = stmt.executeQuery(sql);
            
        DefaultTableModel modeloTabela = null;
        String airbag = null;
        String ALARME = null;
        String AR_CONDICIONADO = null;
        String CD_PLAYER = null;
        String DVD_PLAYER = null;
        String DIR_HIDRAULICA = null;
        String FREIOS_ABS = null;
        String TRAVAS_ELETR = null;
        String VIDROS_ELETR = null;
        String VALOR_COMPRA = null;
        String TETO_SOLAR = null;
        String SENSOR_ESTAC = null;
        String BANCO_COURO = null;
        String LIMPADOR_TRAS = null;
        String DESEMB_TRASEIRO = null;
        String COMP_BORDO = null;
        String DESC_ORIGEM = null;
        String DESC_ESTADO = null;
        
        String desc_combustivel = null;
        String desc_cambio = null;
        String desc_porta = null;
        String desc_MARCA = null;
        String desc_MODELO = null;
        
        if(rs.next()){
           
            modeloTabela = new DefaultTableModel();
            modeloTabela.addColumn("desc_modelo_ano");
            modeloTabela.addColumn("placa");
            modeloTabela.addColumn("kilometragem");
            modeloTabela.addColumn("cor");
            modeloTabela.addColumn("airbag");
            
            
            modeloTabela.addColumn("ALARME");
            modeloTabela.addColumn("AR_CONDICIONADO");
            modeloTabela.addColumn("CD_PLAYER");
            modeloTabela.addColumn("DVD_PLAYER");
            modeloTabela.addColumn("DIR_HIDRAULICA");
            modeloTabela.addColumn("FREIOS_ABS");
            modeloTabela.addColumn("TRAVAS_ELETR");
            modeloTabela.addColumn("VIDROS_ELETR");
            modeloTabela.addColumn("VALOR_COMPRA");
            modeloTabela.addColumn("TETO_SOLAR");
            modeloTabela.addColumn("SENSOR_ESTAC");
            modeloTabela.addColumn("BANCO_COURO");
            modeloTabela.addColumn("LIMPADOR_TRAS");
            modeloTabela.addColumn("DESEMB_TRASEIRO");
            modeloTabela.addColumn("COMP_BORDO");
            modeloTabela.addColumn("DESC_ORIGEM");
            modeloTabela.addColumn("DESC_ESTADO");
            
            
            modeloTabela.addColumn("desc_cambio");
            modeloTabela.addColumn("desc_porta");
            modeloTabela.addColumn("desc_MARCA");
            modeloTabela.addColumn("desc_MODELO");
                
                RdEstado.setText(rs.getString("desc_estado"));
                RdOrigem.setText(rs.getString("desc_origem"));
                TxTFab.setText(rs.getString("desc_modelo_ano"));
                TxtPlaca.setText(rs.getString("placa"));
                TxtKm.setText(rs.getString("kilometragem"));
                TxtCor.setText(rs.getString("cor"));
                
                airbag = rs.getString("airbag");
                
                ALARME = rs.getString("ALARME");
                AR_CONDICIONADO = rs.getString("AR_CONDICIONADO");
                CD_PLAYER = rs.getString("CD_PLAYER");
                DVD_PLAYER = rs.getString("DVD_PLAYER");
                DIR_HIDRAULICA = rs.getString("DIR_HIDRAULICA");
                FREIOS_ABS = rs.getString("FREIOS_ABS");
                TRAVAS_ELETR = rs.getString("TRAVAS_ELETR");
                VIDROS_ELETR = rs.getString("VIDROS_ELETR");
                TETO_SOLAR = rs.getString("TETO_SOLAR");
                SENSOR_ESTAC = rs.getString("SENSOR_ESTAC");
                BANCO_COURO = rs.getString("BANCO_COURO");
                LIMPADOR_TRAS = rs.getString("LIMPADOR_TRAS");
                DESEMB_TRASEIRO = rs.getString("DESEMB_TRASEIRO");
                COMP_BORDO = rs.getString("COMP_BORDO");
                
                
                desc_combustivel = rs.getString("desc_combustivel");
                desc_cambio = rs.getString("desc_cambio");
                desc_porta = rs.getString("desc_porta");
                desc_MARCA  = rs.getString("desc_MARCA");
                desc_MODELO  = rs.getString("desc_MODELO");
                
                
                          
                CombCambio.addItem(desc_cambio);
                CombCombust.addItem(desc_combustivel);
                CombMarca.addItem(desc_MARCA);
                CombModelo.addItem(desc_MODELO);
                CombPortas.addItem(desc_porta);
                
                CombCambio.setSelectedIndex(1);
                CombCombust.setSelectedIndex(1);
                CombMarca.setSelectedIndex(1);
                CombModelo.setSelectedIndex(1);
                CombPortas.setSelectedIndex(1);
                
                if(airbag.equals("1"))
                {
                    ChAirBag.setSelected(true);
                }
                
                if(ALARME.equals("1"))
                {
                    ChAlarme.setSelected(true);
                }
                
                if(AR_CONDICIONADO.equals("1"))
                {
                    ChArCond.setSelected(true);
                }
                                
                if(CD_PLAYER.equals("1"))
                {
                    ChCd.setSelected(true);
                }        
                
                if(DVD_PLAYER.equals("1"))
                {
                    ChDvd.setSelected(true);
                }
                        

                if(DIR_HIDRAULICA.equals("1"))
                {
                    ChDirHi.setSelected(true);
                }
                
                if(FREIOS_ABS.equals("1"))
                {
                    ChAbs.setSelected(true);
                }
                
                if(TRAVAS_ELETR.equals("1"))
                {
                    ChTravas.setSelected(true);
                }
                
                if(VIDROS_ELETR.equals("1"))
                {
                    ChVidros.setSelected(true);
                }
                
                                
                if(TETO_SOLAR.equals("1"))
                {
                    ChTeto.setSelected(true);
                }
                
                if(SENSOR_ESTAC.equals("1"))
                {
                    ChSensor.setSelected(true);
                }
                
                if(BANCO_COURO.equals("1"))
                {
                    ChBanco.setSelected(true);
                }
                
                if(LIMPADOR_TRAS.equals("1"))
                {
                    ChLimpador.setSelected(true);
                }
                
                if(DESEMB_TRASEIRO.equals("1"))
                {
                    ChDesen.setSelected(true);
                }
                
                if(COMP_BORDO.equals("1"))
                {
                    ChCompu.setSelected(true);
                }
                
                

}else JOptionPane.showMessageDialog(null, "VEICULO NÃO CADASTRADO!", "ATENÇÃO!",JOptionPane.WARNING_MESSAGE);        
        } catch (SQLException ex) {
            Logger.getLogger(Cadastro_Usuario.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_BtAtualizarActionPerformed

    private void BrGerarVendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BrGerarVendaActionPerformed
        // TODO add your handling code here:
        Veiculo veiculo = new Veiculo();
        
            veiculo.setPlaca(TxtPlaca.getText());
            veiculo.setCodCliente(TxtCodCliente.getText());
            veiculo.setValorVeiculo(TxtValorVeiculo.getValue());
            veiculo.setEntrada(TxtEntrada.getValue());
            veiculo.setParcelado(TxtParcelado.getValue());
        
        Pedidos_VeiculoDAO pedidos_veiculoDAO = new Pedidos_VeiculoDAO();
        pedidos_veiculoDAO.adiciona(veiculo);
        JOptionPane.showMessageDialog(null,"Veiculo Cadastrado com Sucesso");


    }//GEN-LAST:event_BrGerarVendaActionPerformed

    private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
        // TODO add your handling code here:
       /* try {
            ResultSet rs = null;
            String sql = "SELECT desc_login,senha FROM tb_usuario where id_usuario = 3";
            PreparedStatement stmt = connection.prepareStatement(sql);
            rs = stmt.executeQuery(sql);


            // DefaultTableModel modeloTabela = null;
            while (rs.next()) {

                //  modeloTabela = new DefaultTableModel();

                //  modeloTabela.addColumn("desc_login");
                //  modeloTabela.addColumn("senha");

                TxtUsuario.setText(rs.getString("desc_login"));
                TxtSenha.setText(rs.getString("senha"));

//modeloTabela.insertRow(0,Campo);

//tb = new JTable(modeloTabela);	


            }
        } catch (SQLException ex) {
            Logger.getLogger(Cadastro_Usuario.class.getName()).log(Level.SEVERE, null, ex);
        }*/
    }//GEN-LAST:event_jButton10ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Pedidos_Veiculo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Pedidos_Veiculo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Pedidos_Veiculo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Pedidos_Veiculo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Pedidos_Veiculo().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BrGerarVenda;
    private javax.swing.JButton BtAtualizar;
    private javax.swing.JButton BtNovoCliente;
    private javax.swing.JButton BtVoltar;
    private javax.swing.JCheckBox ChAbs;
    private javax.swing.JCheckBox ChAirBag;
    private javax.swing.JCheckBox ChAlarme;
    private javax.swing.JCheckBox ChArCond;
    private javax.swing.JCheckBox ChBanco;
    private javax.swing.JCheckBox ChBanco1;
    private javax.swing.JCheckBox ChCd;
    private javax.swing.JCheckBox ChCompu;
    private javax.swing.JCheckBox ChDesen;
    private javax.swing.JCheckBox ChDirHi;
    private javax.swing.JCheckBox ChDvd;
    private javax.swing.JCheckBox ChLimpador;
    private javax.swing.JCheckBox ChSensor;
    private javax.swing.JCheckBox ChTeto;
    private javax.swing.JCheckBox ChTravas;
    private javax.swing.JCheckBox ChVidros;
    private javax.swing.JTextField CodCarroPlaca;
    private javax.swing.JLabel CodCliente;
    private javax.swing.JComboBox CombCambio;
    private javax.swing.JComboBox CombCombust;
    private javax.swing.JComboBox CombMarca;
    private javax.swing.JComboBox CombModelo;
    private javax.swing.JComboBox CombPortas;
    private javax.swing.JLabel Cor;
    private javax.swing.JPanel Dados_Veiculo;
    private javax.swing.JLabel Entrada;
    private javax.swing.JLabel Fabric;
    private javax.swing.JLabel InfCadCarroPlaca;
    private javax.swing.JLabel Km;
    private javax.swing.JLabel Opcionais;
    private javax.swing.JLabel Parcelado;
    private javax.swing.JLabel Placa;
    private javax.swing.JRadioButton RdEstado;
    private javax.swing.JRadioButton RdOrigem;
    private javax.swing.JLabel Titulo;
    private javax.swing.JTextField TxTFab;
    private javax.swing.JTextField TxtCodCliente;
    private javax.swing.JTextField TxtCor;
    private sellcar.JNumberFormatField TxtEntrada;
    private javax.swing.JTextField TxtKm;
    private javax.swing.JTextField TxtNomeCliente;
    private sellcar.JNumberFormatField TxtParcelado;
    private javax.swing.JFormattedTextField TxtPlaca;
    private sellcar.JNumberFormatField TxtValorFinanciado;
    private sellcar.JNumberFormatField TxtValorVeiculo;
    private javax.swing.JLabel ValorFinanciado;
    private javax.swing.JLabel ValorVeiculo;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    // End of variables declaration//GEN-END:variables
}
